package com.earl.user.controller;

import com.earl.user.entity.po.UserInfo;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test")
public class MockMvcController {

    @GetMapping("/user")
    public UserInfo getUser(@RequestParam(required = false) String userId, @RequestParam(required = false) String name) {
        UserInfo userInfo = new UserInfo();
        userInfo.setUserId(userId);
        userInfo.setName(name);
        return userInfo;
    }

    @PostMapping("/user")
    public UserInfo getUser(@RequestBody UserInfo userInfo) {
        return userInfo;
    }

}
